<?php


namespace app\common\service\companyIndustry\tsinghua;

use app\common\service\{
    BaseService, EmissionService, InletFlueGasService, FlugGasService
};
use app\common\service\companyIndustry\industrymodel\TsinghuaDrainEmissionToFacilityParam;

/**
 * 清华方案 脱硝运行浓度
 */
class NitreConcentrationService extends BaseService
{
    /**
     * （方案值）运行浓度
     * @author hongwei 2019-07-26
     * @param $planNumber
     * @param $tsinghuaName
     * @param $facilityId
     * @return bool
     * @throws \MongoDB\Driver\Exception\Exception
     */
    public function singleCompanySingleDrainSingleFacility($planNumber, $tsinghuaName, $facilityId)
    {
        $tsinghua = new TsinghuaDrainEmissionToFacilityParam();
        $result = $tsinghua->getPlanParamByFacilityId($facilityId, $planNumber, $tsinghuaName, 'NO2');
        if (!$result) {
            return false;
        }
        return getNum($result['concentration'], 2);
    }

    /**
     * （减排前）脱硫运行效率 - 返回天数
     * @author hongwei 2019-07-26
     * @param int $companyId
     * @param int $drainId
     * @param int $facilityId
     * @param string $type days天数| hours小时数
     * @return int
     */
    public function singleCompanySingleDrainSingleFacilityDetails($planNumber, $tsinghuaName, $facilityId, $type = 'days')
    {
        $date   = ['07/22', '07/22', '07/22', '07/22'];
        $data   = [1, 2, 3, 4];
        $result = [
            'date' => $date,
            'data' => $data,
        ];
        return $result;
    }

}